package com.compay4;

import java.sql.ResultSet;
import java.sql.SQLException;

public class ShoppingService {
    ShoppingDAO dao = new ShoppingDAO();

    //查找传递
    public ResultSet findFromShoppingInfo() throws SQLException {
        return dao.find();
    }

    //添加传递
    public void addShopping(String number1, String name1, String price1) throws SQLException {
        //调用dao
        dao.add(number1, name1, price1);
    }

    //删除编号传递
    public void deleteShoppingNumber(String number2) throws SQLException {
        dao.deleteNumber(number2);
    }

    //删除名称传递
    public void deleteShoppingName(String name2) throws SQLException {
        dao.deleteName(name2);
    }

    //修改编号传递
    public void correctShoppingNumber(String price2, String number) throws SQLException {
        dao.correctNumber(price2, number);
    }

    //修改名称传递
    public void correctShoppingName(String price3, String name) throws SQLException {
        dao.correctName(price3, name);
    }
}
